package April.Twenty_six;

import April.twenty_five.JdbcUtilDemo_1;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/*
调用 上一天中的 JdbcUtilDemo_1
 */
public class JdbcDemo_5 {
    public static void main(String[] args) throws SQLException {
        Connection con = JdbcUtilDemo_1.getConnection();
        PreparedStatement pst = con.prepareStatement("SELECT  name FROM zhangwu ");
        ResultSet rs = pst.executeQuery();
                while(rs.next()){
                    System.out.println(rs.getString("name"));
                }
        JdbcUtilDemo_1.close(con,pst,rs);
    }
}
